import { Component, OnInit } from '@angular/core';
import { NzMessageService } from 'ng-zorro-antd/message';

@Component({
  selector: 'app-config-short-address',
  templateUrl: './config-short-address.component.html',
  styleUrls: ['./config-short-address.component.scss']
})
export class ConfigShortAddressComponent implements OnInit {


  messageId: string = "";

  constructor(
    private message: NzMessageService,
  ) { }

  ngOnInit() {}

  /**
   * 开启loading
   */
  createBasicMessage(): void {
    this.messageId = this.message.loading('正在请求...', { nzDuration: 0 }).messageId;
  }
  /**
   * 移除loading
   */
  removeBasicMessage() {
    this.message.remove(this.messageId);
    this.messageId = "";
  }
  /**
   * 全局展示操作反馈信息
   * @param type 其他提示类型 success:成功 error:失败 warning：警告
   */
  createMessage(type: any, str: any): void {
    this.message.create(type, str);
  }
}
